From 3d9c2c88b1fea4cc79b67fa559c5cbb14fca47a6 Mon Sep 17 00:00:00 2001 From: oliskoli Date: Sun, 7 Sep 2008 16:46:59 +0000 Subject: [PATCH] waypt: Add function 'waypt_disp_session'. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@3473 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/waypt.c | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/gpsbabel/waypt.c b/gpsbabel/waypt.c index 7ff60bf27..065f388dd 100644 --- a/gpsbabel/waypt.c +++ b/gpsbabel/waypt.c @@ -244,21 +244,7 @@ waypt_status_disp(int total_ct, int myct) void waypt_disp_all(waypt_cb cb) { - queue *elem, *tmp; - waypoint *waypointp; - int i = 0; - - QUEUE_FOR_EACH(&waypt_head, elem, tmp) { - waypointp = (waypoint *) elem; - if (global_opts.verbose_status) { - i++; - waypt_status_disp(waypt_ct, i); - } - (*cb) (waypointp); - } - if (global_opts.verbose_status) { - fprintf(stdout, "\r\n"); - } + waypt_disp_session(NULL, cb); } void @@ -270,7 +256,7 @@ waypt_disp_session(const session_t *se, waypt_cb cb) QUEUE_FOR_EACH(&waypt_head, elem, tmp) { waypointp = (waypoint *) elem; - if (waypointp->session == se) { + if ((se == NULL) || (waypointp->session == se)) { if (global_opts.verbose_status) { i++; waypt_status_disp(waypt_ct, i); -- 2.30.2